using System.Web;
using System.Xml;
using System;

/*	-----------------------------------------------------------------------	
	Copyright:	umlungu consulting (pty) ltd
	Author:		Alan Benington	
	Started:	2006-03-08	
	Status:		release	
	Version:	2.0.0
	Buidl:		20080319
	License:	GNU General Public License
	-----------------------------------------------------------------------	*/

/*	---------------------------------------------------------------------------	
	Development Notes:
	==================
	20070616:	New configuration object
	20080306:	Added <Validation> element to hold validation redirect
	20080401:	Added config for template preloading in global.asax
	---------------------------------------------------------------------------	*/
	
namespace umlungu.engineX.blogX {
	/// <summary>
	/// Description of the x_config class.
	/// <para>Additional information about the class</para>
	/// </summary>
	public class x_config : umlungu.engineX.x_config {
		#region Invisible properties
		#endregion

		#region Constants
		private const string CONFIG_ROOT = "BlogX";
		private const string CONFIG_PROF = "Profile";
		private const string CONFIG_EMAIL = "Email";
		private const string CONFIG_SPAM = "Spam";
		private const string CONFIG_NEWS = "News";
		private const string CONFIG_VALIDATION = "Validation";
		private const string CONFIG_INVALID	= "validation_failure";
		private const string CONFIG_VALID	= "validation_success";
		private const string CONFIG_TEMPLATE = "Template";
		#endregion

		#region Visible properties
		/// <summary>The Site profile flag</summary>
		/// <value>Indicates if the profile flag is set</value>
		public string SiteProfile {
			get { return Value(String.Concat(CONFIG_ROOT, "/", CONFIG_PROF, "/@site")); }
		}
		/// <summary>The User profile flag</summary>
		/// <value>Indicates if the profile flag is set</value>
		public string UserProfile {
			get { return Value(String.Concat(CONFIG_ROOT, "/", CONFIG_PROF, "/@user")); }
		}
		/// <summary>The default space (holds site xsl templates)</summary>
		/// <value>The name of the default thoughtspace</value>
		public string Space {
			get { return Value(String.Concat(CONFIG_ROOT, "/@space")); }
		}
		/// <summary>The name of the host server</summary>
		/// <value>The root url of the host server eg "localhost" or "www.umlungu.co.za"</value>
		public string Host {
			get { return Value(String.Concat(CONFIG_ROOT, "/@host")); }
		}
		/// <summary>The path to the application on the host web server</summary>
		/// <value>The path eg "/testsite/" or "/"</value>
		public string Path {
			get { return Value(String.Concat(CONFIG_ROOT, "/@path")); }
		}
		/// <summary>The link for the primary login page</summary>
		/// <value>The path eg 'site_login' or 'ipassport_login'</value>
		public string LoginLink {
			get { return Value(String.Concat(CONFIG_ROOT, "/@login")); }
		}
		/// <summary>The link for the pattern login page (ie page for login when link requires a pattern)(</summary>
		/// <value>The path eg 'ipassport_pattern'</value>
		public string PatternLink {
			get { return Value(String.Concat(CONFIG_ROOT, "/@pattern")); }
		}
		/// <summary>The url for the redirect when invalid</summary>
		/// <value>The path eg 'default.aspx?link=ipassport_login'</value>
		public string InvalidRedirect {
			get { return Value(String.Concat(CONFIG_ROOT, "/", CONFIG_VALIDATION, "/Url[@id='", CONFIG_INVALID, "']")); }
		}
		/// <summary>The url for the redirect when valid</summary>
		/// <value>The path eg 'default.aspx?link=site_home'</value>
		public string ValidRedirect {
			get { return Value(String.Concat(CONFIG_ROOT, "/", CONFIG_VALIDATION, "/Url[@id='", CONFIG_VALID, "']")); }
		}
		/// <summary>The from address for email</summary>
		/// <value>email address</value>
		public string EmailFrom {
			get { return Value(String.Concat(CONFIG_ROOT, "/", CONFIG_EMAIL, "/@from")); }
		}
		/// <summary>The to address for email</summary>
		/// <value>email address</value>
		public string EmailTo {
			get { return Value(String.Concat(CONFIG_ROOT, "/", CONFIG_EMAIL, "/@to")); }
		}
		/// <summary>The bcc address for email</summary>
		/// <value>email address</value>
		public string EmailBcc {
			get { return Value(String.Concat(CONFIG_ROOT, "/", CONFIG_EMAIL, "/@bcc")); }
		}
		/// <summary>The subject  for email</summary>
		/// <value>subject</value>
		public string EmailSubject {
			get { return Value(String.Concat(CONFIG_ROOT, "/", CONFIG_EMAIL)); }
		}
		/// <summary>The email server</summary>
		/// <value>email server host name</value>
		public string EmailHost {
			get { return Value(String.Concat(CONFIG_ROOT, "/", CONFIG_EMAIL, "/@host")); }
		}
		/// <summary>The docpath for email attatchments</summary>
		/// <value>path to directory relative to root</value>
		public string EmailDocPath {
			get { return Value(String.Concat(CONFIG_ROOT, "/", CONFIG_EMAIL, "/@docpath")); }
		}
		/// <summary>The list of spam words</summary>
		/// <value>A list or words delimited by "|" to identify words used in spam posts</value>
		public string SpamList {
			get { return Value(String.Concat(CONFIG_ROOT, "/", CONFIG_SPAM)); }
		}
		/// <summary>The path for newsletter xsl templates</summary>
		/// <value>path to directory relative to root</value>
		public string NewsXslPath {
			get { return Value(String.Concat(CONFIG_ROOT, "/", CONFIG_NEWS, "/@xslpath")); }
		}
		/// <summary>The path for newsletter logs</summary>
		/// <value>path to directory relative to root</value>
		public string NewsLogPath {
			get { return Value(String.Concat(CONFIG_ROOT, "/", CONFIG_NEWS, "/@logpath")); }
		}
		/// <summary>The flag for template preloading</summary>
		/// <value>yes if preloading desired (needs Application var in global.asax created)</value>
		public string TemplatePreload {
			get { 
				return Value(String.Concat(CONFIG_ROOT, "/", CONFIG_TEMPLATE, "/@preload")); }
		}
		/// <summary>The name of the preloaded template</summary>
		/// <value>name string of Application variable in global.asax</value>
		public string Template {
			get { return Value(String.Concat(CONFIG_ROOT, "/", CONFIG_TEMPLATE)); }
		}
		#endregion

		#region Constructors/Destructors
		/// <overloads>Constructor</overloads>
		/// <summary>Default constructor</summary>
		public x_config() : base() {
		}
		#endregion

		#region Public methods
		/// <overloads>Description of the overloaded example method</overloads>
		/// <summary>Description of this method overload</summary>
		/// <param name="parameter">Brief description of the parameter</param>
		public void Example(string parameter) {
		}
		/// <summary>Description of this method overload</summary>
		/// <param name="parameter">Brief description of the parameter</param>
		public void Example(int parameter) {
		}
		#endregion
		
		#region Protected methods
		/// <summary>
		/// Description of this method
		/// </summary>
		protected void _Example() {
		}
		#endregion
		
		#region Private methods
		/// <summary>
		/// Description of this method
		/// </summary>
		private void example() {
		}
		#endregion
	}
}
